﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerItem : MonoBehaviour {

    public UISprite avatar;
    public UILabel nameLabel;
    public UILabel coinLabel;
    public GameObject avatarBtn;
    public UITexture wxAvatar;
    public int uid;

    void Start()
    {
        UIEventListener.Get(avatarBtn).onClick = ButtonClick;        
    }

    void ButtonClick(GameObject button)
    {
        if(button.name == "Avatar"){
            if(uid != 0){
                GameObject userInfo = NGUITools.AddChild(GameObject.Find("UI Root"), (GameObject)Resources.Load(GameDN100PrefabPath.DN100UserInfo));
                DN100UserInfo dn100UserInfo = userInfo.GetComponent<DN100UserInfo>();
                dn100UserInfo.LoadUserInfo(uid);
                dn100UserInfo.uid = uid;
            }            
        }
    }

   
}
